﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KamLib;

namespace Ext.Net.UIS
{

    public class FieldSet : Ext.Net.FieldSet, ITermBox
    {
        public new Context Context { get; set; }
        public string Name { get; set; }
        public Term Term { get; set; }
        public TermNode ParentTermNode { get; set; }
        public TermNode TermNode { get; set; }

        public string ItemNames { get; set; }

        public bool ControlsCreated { get; set; }
        public void CreateControls(UisCreateControlArgs e)
        {
            this.UisGetTermNode();
            if (TermNode == null) return;

            TermNode.ApplyToContainer(this);

            if (ItemNames.yes())
            {
                Items.Add(new FieldBox(ItemNames));
                ItemNames = null;
            }

            if (Title.no()) Title = TermNode.Title;
        }

    }

}
